import request from '@/utils/request'

export default class Salary {
  static getSalarysList(data: any) {
    return request({
      url: '/salarys/list',
      data,
      method: 'post'
    })
  }
  /**
   * 获取员工列表
   * **/

  static getEmployeeList(params: any) {
    return request({
      url: '/sys/user',
      params // 地址参数 查询参数
    })
  }
  static getTips(yearMonth: any) {
    return request({
      url: `/salarys/tips/${yearMonth}`
    })
  }
  static getSettings() {
    return request({
      url: '/salarys/settings'
    })
  }

  static getCompanySetting() {
    return request({
      url: '/salarys/company-settings'
    })
  }
  static saveSettings(data: any) {
    return request({
      url: '/salarys/settings',
      method: 'post',
      data
    })
  }

  static getSalaryDetail(userId: any) {
    return request({
      url: `/salarys/modify/${userId}`
    })
  }
  static changeSalary(data: any) {
    return request({
      url: `/salarys/modify/${data.userId}`,
      method: 'post',
      data
    })
  }
  static initSalary(data: any) {
    return request({
      url: `/salarys/init/${data.userId}`,
      method: 'post',
      data
    })
  }
  static getArchivingList(params: any) {
    return request({
      url: `/salarys/reports/${params.year}`,
      params
    })
  }
  static getArchivingCont(params: any) {
    return request({
      url: `/salarys/reports/${params.yearMonth}`,
      params
    })
  }
  static newReport(data: any) {
    return request({
      url: `/salarys/reports/${data.yearMonth}/newReport`,
      method: 'put',
      data
    })
  }
  static getArchivingExport(params: any) {
    return request({
      url: `/salarys/reports/${params.yearMonth}/export`,
      params
    })
  }
  static getArchivingFirst(params: any) {
    return request({
      url: `/salarys/reports/${params.yearMonth}/first`,
      params
    })
  }
  static getArchivingArchive(data: any) {
    return request({
      url: `/salarys/reports/${data.yearMonth}/archive`,
      data,
      method: 'post'
    })
  }
}
